package org.ricks.ioc.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chenwei
 * @Title:
 * @Package
 * @Description:
 * @date 2020/6/2815:51
 */
public class BeanDefinition {

    //bean id
    private Object bean;

    //bean对应类全名
    private Class beanClass;

    // bean对象的属性
    private List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>();

    public BeanDefinition() {
    }

    public void setBean(Object bean) {
        this.bean = bean;
    }

    public Class getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(Class beanClass) {
        this.beanClass = beanClass;
    }


    public Object getBean() {
        return bean;
    }


    /**
     * @return the propertyDefinitions
     */
    public List<PropertyDefinition> getPropertyDefinitions() {
        return propertyDefinitions;
    }

    /**
     * @param propertyDefinitions
     *            the propertyDefinitions to set
     */
    public void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions) {
        this.propertyDefinitions = propertyDefinitions;
    }

    /**
     * addPropertyDefinition
     *
     * @param propertyDefinition
     */
    public void addPropertyDefinition(PropertyDefinition propertyDefinition) {
        if (null != propertyDefinitions) {
            propertyDefinitions.add(propertyDefinition);
        }
    }

}
